<!DOCTYPE html>
<html>
<head>
  	<#import "../common/common.macro.ftl" as netCommon>
    <title>DATAX管理中心</title>
	<@netCommon.commonStyle />
    <!-- DataTables -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <!-- daterangepicker -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/bower_components/bootstrap-daterangepicker/daterangepicker.css">
</head>
<body class="hold-transition skin-blue sidebar-mini <#if cookieMap?exists && cookieMap["datax_adminlte_settings"]?exists && "off" == cookieMap["datax_adminlte_settings"].value >sidebar-collapse</#if>">
<div class="wrapper">
	<!-- header -->
	<@netCommon.commonHeader />
	<!-- left -->
	<@netCommon.commonLeft "jobinfo" />

	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>任务管理<small></small></h1>
		</section>

		<!-- Main content -->
	    <section class="content">

	    	<div class="row">
                <div class="col-xs-3">
                    <input type="text" class="form-control" id="name" autocomplete="on" value="${topic!''}" placeholder="请输任务名，精确匹配或模糊匹配" >
                </div>
	            <div class="col-xs-1">
	            	<button class="btn btn-block btn-info" id="searchBtn">搜索</button>
	            </div>
                <div class="col-xs-2">
                    <div class="btn-group">
                        <button class="btn btn-default pull-left" id="job_add">添加</button>
                    </div>
                </div>
          	</div>

			<div class="row">
				<div class="col-xs-12">
					<div class="box">
			            <div class="box-body">
			              	<table id="data_list" class="table table-bordered table-striped" width="100%" >
				                <thead>
					            	<tr>
					                	<th name="sysId" >任务编号</th>
					                	<th name="name" >任务名</th>
					                  	<th name="createTime" >创建时间</th>
                                        <th name="modifyTime" >修改时间</th>
                                        <th name="path" >文件路径</th>
                                        <th name="params" >执行参数</th>
                                        <th name="range" >同步范围</th>
                                        <th name="unit" >单位</th>
                                        <th name="cron" >执行周期</th>
                                        <th name="description" >说明</th>
                                        <th name="content" >内容</th>
                                        <th name="status" >状态</th>
					                  	<th>操作</th>
					                </tr>
				                </thead>
				                <tbody></tbody>
				                <tfoot></tfoot>
							</table>
						</div>
					</div>
				</div>
			</div>

	    </section>
	</div>

    <!-- 新增.模态框 -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" >新增JOB文件</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form" role="form" >
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">文件名 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="name" maxlength="15" placeholder="请输JOB入文件名" ></div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">参数名 <font color="black">*</font></label>
                            <div class="col-sm-10">
                                <#--<input type="text" class="form-control" name="params" maxlength="255" placeholder="目前参数名仅限[startId|endId|startTime|endTime]按‘,’分隔" >-->
                                <input type="checkbox" name="params" value="startId">起始id
                                <input type="checkbox" name="params" value="endId">结束id
                                <input type="checkbox" name="params" value="startTime">起始时间
                                <input type="checkbox" name="params" value="endTime">结束时间
                            </div>
                        </div>
                        <#--固定同步范围-->
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">同步范围 <font color="black">*</font></label>
                            <div class="col-sm-8 "><input type="text" class="form-control" name="range" maxlength="10" placeholder="请输入同步范围" ></div>
                        </div>
                        <#--固定同步范围-->
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">单位 <font color="black">*</font></label>
                            <div class="col-sm-10 ">
                                <input type="radio" name="unit" value="1">年
                                <input type="radio" name="unit" value="2">月
                                <input type="radio" name="unit" value="3">日
                                <input type="radio" name="unit" value="4">时
                                <input type="radio" name="unit" value="5">分
                                <input type="radio" name="unit" value="6">秒
                                <input type="radio" name="unit" value="7">条
                                <input type="radio" name="unit" value="0">none
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">执行周期 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="cron" maxlength="128" placeholder="请输入JOB执行周期，如 * 5/15 * * * *" ></div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">说明 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="description" maxlength="255" placeholder="请输入JOB说明" ></div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">内容 <font color="red">*</font></label>
                            <div class="col-sm-8">
                                <textarea class="textarea" name="content" maxlength="10000" placeholder="请输入JOB文件内容；限制为字符串数组JSON格式，如 {'json':{'content':[{}]}}" style="width: 100%; height: 100px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-6">
                                <button type="submit" class="btn btn-primary"  >保存</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- 更新.模态框 -->
    <div class="modal fade" id="modifyModal" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" >更新JOB文件</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form" role="form" >
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">文件名 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="name" maxlength="15" placeholder="请输JOB入文件名" readonly ></div>
                        </div>
<#--                        <div class="form-group">-->
<#--                            <label for="lastname" class="col-sm-2 control-label">创建时间 <font color="black">*</font></label>-->
<#--                            <div class="col-sm-8"><input type="hidden" class="form-control" name="createTime" maxlength="255" placeholder="请输创建时间" readonly ></div>-->
<#--                        </div>-->
<#--                        <div class="form-group">-->
<#--                            <label for="lastname" class="col-sm-2 control-label">修改时间 <font color="black">*</font></label>-->
<#--                            <div class="col-sm-8"><input type="hidden" class="form-control" name="modifyTime" maxlength="255" placeholder="请输修改时间" readonly ></div>-->
<#--                        </div>-->
<#--                        <div class="form-group">-->
<#--                            <label for="lastname" class="col-sm-2 control-label">文件路径 <font color="black">*</font></label>-->
<#--                            <div class="col-sm-8"><input type="hidden" class="form-control" name="path" maxlength="255" placeholder="请输文件路径" readonly ></div>-->
<#--                        </div>-->
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">参数名 <font color="black">*</font></label>
                            <div class="col-sm-8">
<#--                                <input type="text" class="form-control" name="params" maxlength="255" placeholder="目前参数名仅限[startId|endId|startTime|endTime]按‘,’分隔" >-->
                                <input type="checkbox" name="params" value="startId">起始id
                                <input type="checkbox" name="params" value="endId">结束id
                                <input type="checkbox" name="params" value="startTime">起始时间
                                <input type="checkbox" name="params" value="endTime">结束时间
                            </div>
                        </div>
                        <#--固定同步范围-->
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">同步范围 <font color="black">*</font></label>
                            <div class="col-sm-8 "><input type="text" class="form-control" name="range" maxlength="10" placeholder="请输入同步范围" ></div>
                        </div>
                        <#--固定同步范围-->
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">单位 <font color="black">*</font></label>
                            <div class="col-sm-10 ">
                                <input type="radio" name="unit" value="1">年
                                <input type="radio" name="unit" value="2">月
                                <input type="radio" name="unit" value="3">日
                                <input type="radio" name="unit" value="4">时
                                <input type="radio" name="unit" value="5">分
                                <input type="radio" name="unit" value="6">秒
                                <input type="radio" name="unit" value="7">条
                                <input type="radio" name="unit" value="0">none
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">执行周期 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="cron" maxlength="15" placeholder="请输入JOB执行周期，如 * 5/15 * * * *" ></div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">说明 <font color="red">*</font></label>
                            <div class="col-sm-8"><input type="text" class="form-control" name="description" maxlength="255" placeholder="请输入JOB说明" ></div>
                        </div>
                        <div class="form-group">
                            <label for="lastname" class="col-sm-2 control-label">内容 <font color="red">*</font></label>
                            <div class="col-sm-8">
                                <textarea class="textarea" name="content" maxlength="10000" placeholder="请输入JOB文件内容；限制为字符串数组JSON格式，如 {'json':{'content':[{}]}}" style="width: 100%; height: 100px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-6">
                                <button type="submit" class="btn btn-primary"  >更新</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<#--								<input type="hidden" name="id">-->
                                <input type="hidden" class="form-control" name="sysId">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

	<!-- footer -->
	<@netCommon.commonFooter />
</div>

<#-- trigger -->
<div class="modal fade" id="jobTriggerModal" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" >执行</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal form" role="form" >
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">任务参数<font color="black">*</font></label>
                        <div class="col-sm-10">
                            <textarea class="textarea form-control" name="params" placeholder="请输入任务参数" maxlength="512" style="height: 63px; line-height: 1.2;"></textarea>
                        </div>
                    </div>
                    <hr>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-6">
                            <button type="button" class="btn btn-primary ok" >保存</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <input type="hidden" name="sysId" >
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<@netCommon.commonScript />
<!-- DataTables -->
<script src="${request.contextPath}/static/adminlte/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="${request.contextPath}/static/adminlte/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<script src="${request.contextPath}/static/plugins/jquery/jquery.validate.min.js"></script>

<script src="${request.contextPath}/static/js/jobinfo.index.1.js"></script>

</body>
</html>
